public class Teacher {
    // 属性
    public String id;
    public String name;
    public String gender;
    public String courseId; // 所授课程的ID

    // 构造方法
    public Teacher(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.courseId = ""; // 初始为空
    }

    // 显示教师信息
    public void showInfo() {
        System.out.println("教师编号: " + id);
        System.out.println("教师姓名: " + name);
        System.out.println("性别: " + gender);
        System.out.println("所授课程ID: " + (courseId.isEmpty() ? "无" : courseId));
        System.out.println("-------------------");
    }
}